<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box01{
            width: 200px;
            height: 200px;
            background-color: tomato;
        }
    </style>
</head>

<body>
    <div id="app">
        <!-- 让属性值变成动态的 -->
        <input v-bind:type="type" name="" v-bind:id="idstr" v-bind:value="msg">
        <img v-bind:src="img" v-bind:style="'width:'+w+'px;height:'+h+'px'" >
        <div v-bind:class="divcls"></div>
        <!-- v-bind可以简写为 ： -->
        <div :class="divcls"></div>

        <!-- 让属性名变成动态的（用的比较少）  -->
        <div v-bind:[attr]="divid" >

        </div>

        <!--  -->
        <input type="button" v-bind:disabled="isButtonDisabled" value="测试">
    </div>
</body>

</html>
<script src="./js/vue2.js"></script>
<script>

    let vm = new Vue({
        el: "#app",
        data: {
            idstr: "username",
            msg: "hello vue",
            type: "button",
            img:"./imgs/1.jpg",
            s:"width:100px",
            w:300,
            h:200,
            divcls:"box01",
            attr:"id",
            divid:"div02",
            isButtonDisabled:false
        }
    });


</script>